﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bussiness.DAL.DAOBase
{
    /// <summary>
    /// DbParameter
    /// </summary>
    public class DbParameter
    {
        private object _val;
        private string _paramterName;
        private bool _nText = false;
        public DbParameter()
        {
        }
        public DbParameter(string parameterName, object val)
        {
            _paramterName = parameterName;
            _val = val;
        }

        public DbParameter(string parameterName, object val, int vcheck)
        {
            _paramterName = parameterName;
            if (vcheck == 0)
            {

                if (val == null || val.ToString() == "")
                {
                    _val = null;
                }
                else
                {
                    _val = val;
                }
            }
            else
            {
                _val = val;
            }
        }
        /// <summary>
        /// Parameter name
        /// </summary>
        public string ParameterName
        {
            get
            {
                return _paramterName;
            }
            set
            {
                _paramterName = value;
            }
        }
        /// <summary>
        /// Parameter value
        /// </summary>
        public object Value
        {
            get
            {
                return _val;
            }
            set
            {
                _val = value;
            }
        }
        /// <summary>
        /// Set parameter as Ntext or not
        /// </summary>
        public bool NText
        {
            get { return _nText; }
            set { _nText = value; }
        }
    }
}
